﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tenebrous_Manor
{
    static public class GameBools
    {
        //Create enum so it's easier to note only call, but also to know which array boolean cooresponds to what
        public enum GameBool
        {
            #region game items
            DOORKNOB = 0,
            SCREWDRIVER = 1,
            STUDY_KEY = 2,
            STUDY_NOTE = 3,
            FUSE = 4,
            #endregion

            #region game events
            SEEN_MISSING_KNOB = 5,
            LEVER_PULLED = 6,
            DESK_MOVED = 7,
            SEEN_NUM_LOCK = 8,
            HAVE_COMBINATION = 9,
            BREAKER = 10,
            #endregion

            #region accessible
            BEDROOM = 11,
            STUDY = 12,
            RESEARCH_LAB = 13,
            #endregion

            END = 14
        }

        //Array of bool that will store all game bools.
        static public bool[] game_array = new bool[Enum.GetNames(typeof(GameBool)).Length];

        /**
         * Set the GameBool (given by parameter gb) to value of variable boolean
         * 
         */
        static public void SetBool(GameBool gb, bool boolean)
        {
            game_array[(int)gb] = boolean;
        }


        /**
         *  Returns the boolean value of the GameBool  (given by parameter gb) 
         * 
         */
        static public bool getGameBool(GameBool gb)
        {
            return game_array[(int)gb];
        }

        /*
         * FOR TESTING PURPOSES ONLY!
         */
        static public void setAllTrue()
        {
            for (int i = 0; i <= game_array.Length - 1; i++)
            {
                game_array[i] = true;
            }
        }

        static public void setAllFalse()
        {
            for (int i = 0; i <= game_array.Length - 1; i++)
            {
                game_array[i] = false;
            }
        }
        /**
         * Update Booleans if correct event or items is true.
         * 
         */
        /*public void Update()
        {
            if (game_array[(int)GameBool.DOORKNOB] && game_array[(int)GameBool.SCREWDRIVER])
                SetBool(GameBool.BEDROOM, true);

            if (game_array[(int)GameBool.STUDY_KEY])
                SetBool(GameBool.STUDY, true);

            if (game_array[(int)GameBool.STUDY_NOTE])
                SetBool(GameBool.KITCHEN, true);

            if (game_array[(int)GameBool.LEVER_PULLED])
                SetBool(GameBool.DESK_MOVABLE, true);

            if (game_array[(int)GameBool.DESK_MOVED])
                SetBool(GameBool.BASEMENT, true);

        }*/


    }
}
